﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OOP
{
    class InterfaceDemo4
    {
        //static void Main(string[] args)
        //{
        //    Man man = new Man();
        //    man.love();

        //    //接到杀手任务
        //    IKiller killer = man;
        //    killer.Kill();

        //    IKiller killer1 = new Man();
        //    killer1.Kill();
        //    Man man1 = (Man)killer1;
        //    man1.love();

        //}
    }
    interface IKiller
    {
        void Kill();
    }
    interface IGentleman
    {
        void love();
    }

    //通过显示实现IKiller接口，实现隐藏Killer身份
    class Man : IGentleman, IKiller
    {
        public void love()
        {
            Console.WriteLine("I will love you forever...");
        }

        void IKiller.Kill()
        {
            Console.WriteLine("I will kill the enemy...");
        }
    }
}
